<template>
  <div>子组件2

    <button @click="sendMsg">发送数据</button>
  </div>
</template>

<script>
export default {
  components: {},
  props: {},
  data () {
    return {
      data1: "我是children2子组件的信息"
    }
  },
  computed: {},
  methods: {
    sendMsg () {
      // 发往父组件
      this.$emit("parentGetMsg", this.data1)
      // 发往兄弟组件
      this.$eventbus.$emit("brotherGetMsg", this.data1)
      console.log("点击子组件", this.$parent)
    }
  },
  created () {

  },
  mounted () {

  },
}
</script>
<style scoped></style>